***********************************************
**RESTORING TRUST IN MEXICO’S POLICE***********
**Authors: Ana I. López García & Sarah Berens**
***********************************************
*EXPERIMENT E6

use "Data ready E6.dta", clear 

*Figure 1. Distribution of Dependent Variables
*Figure 2. Average Marginal Effects of Experimental Attributes on Perceptions Police Effectiveness
*Figure 3. Marginal Effects of the Gender Treatment on Police Effectiveness by Occupational Background Treatment
*Figure 4. Average Marginal Effects of Experimental Attributes on Perceptions of Police Misconduct
*Figure 5. Marginal Effects of the Gender Treatment on Police Misconduct by Occupational Background Treatment
*Figure 6. Conditional Marginal Effects of the Gender Treatment on Police Effectiveness by Fear of and Exposure to Crime and Police Abuse
*Figure 7. Conditional Marginal Effects of the Gender Treatment on Police Misconduct by Fear of and Exposure to Crime and Police Abuse
*Figure A1. Conditional Marginal Effects of the Occupational Treatment on Police Effectiveness by Fear of and Exposure to Crime and Police Abuse
*Figure A2. Conditional Marginal Effects of the Occupational Treatment on Police Misconduct by Fear of and Exposure to Crime and Police Abuse


***************************************************
*DESCRIPTIVE PLOTS - DV

*Plot style
grstyle init 
grstyle set plain, nogrid
grstyle set color mono
grstyle set legend, nobox
graph set window fontface "Arial"

graph drop _all 

*DVs
*FIGURE 1 - Police effectiveness DV 
catplot E6_police_effectiveness, name(catplot1) percent recast(bar) ///
	ytitle("Respondents (%)", margin(small) size(small)) ///
	var1opts(label(labsize(medsmall)) ///
	relabel(1 "Not at all" 2 "A little" 3"Somewhat" 4 "A lot")) ///
	bar(1, fintensity(inten90))  ///
	bar(2, fintensity(inten90)) ///
	bar(3, fintensity(inten90)) ///
	bar(4, fintensity(inten90)) ///
	title("Police Effectiveness", size(vlarge)) ///
	b1title("") ///
	scale(0.85)

*FIGURE 1 - Police misconduct DV
catplot E6_police_misconduct, name(catplot2) percent recast(bar)  ///
	ytitle("Respondents (%)", margin(small) size(small)) ///
	var1opts(label(labsize(medsmall)) ///
	relabel(1"Not at all" 2 "A little" 3"Somewhat" 4 "A lot")) ///
	bar(1, fintensity(inten70))  ///
	bar(2, fintensity(inten70)) ///
	bar(3, fintensity(inten70)) ///
	bar(4, fintensity(inten70)) ///
	title("Police Misconduct", size(vlarge)) ///
	b1title("") ///
	scale(0.85)

*FIGURE 1 - Distribution of Dependent Variables
grstyle set graphsize 7.5 16 
grc1leg2 catplot1 catplot2, cols(2) ycommon ytol1title loff  title("") 
graph save "Figure1.gph", replace 
graph export "Figure1.eps", as(eps) replace 
graph export "Figure1.tif", as(tif) replace 
graph export "Figure1.wmf", as(wmf) replace 	
graph export "Figure1.png", as(png) height(1200) width(2560) replace 


****************************************************
grstyle set graphsize 7.5 8.5 
*FIGURE 2 - Average Marginal Effects of Experimental Attributes on Perceptions Police Effectiveness
reg E6_police_eff  i.E6_vign2 i.E6_vign1
est store effectiveness

coefplot (effectiveness, level(95 90) ciopts(lcolor(black))  mlcolor(black) mfcolor(white)), ///
	xline(0, lcolor(black) lwidth(medium) lpat(shortdash)) baselevels  ///
	drop(_cons)  ylab(, labsize(small))  ///
	xtitle("Point estimates", size(small) margin(l+0 r+0 b+0 t+3)) ///
	xlab(-0.40(0.1).40, labsize(small)) /// 
	headings(0.E6_vign1 = "{bf: Gender}" ///
	0.E6_vign2 = "{bf:Occupation}") ///
	ciopts(recast(rspike)) ///
	mlabposition(center) ///
	title("") ///
	msize(small) msymbol(o) mlabposition(center) ///
	coeflabels(, labsize(small)) 
graph save "Figure2.gph", replace 
graph export "Figure2.eps", as(eps) replace 
graph export "Figure2.tif", as(tif) replace 
graph export "Figure2.wmf", as(wmf) replace 	
graph export "Figure2.png", as(png) height(1200) width(1360) replace 


**************************************************************************
*FIGURE 3 - Marginal Effects of the Gender Treatment on Police Effectiveness by Occupational Background Treatment
grstyle set graphsize 7.5 8.5 
anova E6_police_eff i.E6_vign2##i.E6_vign1
est store 	mod3

grstyle set legend 4, inside
grstyle numstyle legend_rows 2

est restore mod3
margins		E6_vign2, dydx(E6_vign1) level(90) post 

grstyle set graphsize 7.5 10
coefplot (, level(95 90) ciopts(lcolor(black))  mlcolor(black) mfcolor(white)), ///
	scale(0.95) ylab(-.2(.1).7, labsize(small)) vertical yline(0, lcolor(black) lpat(shortdash)) ///
	msize(small) msymbol(o) mlabposition(center) ///
	xlabel(1 "undefined" 2 "soldier" 3 "private security" 4 "self-defence" 5 "activist" 6 "US returnee", labsize(small))  ///	
	title("", margin(small) size(medium)) ///
	ytitle("ME(gender)", margin(l+0 r+3 b+0 t+0)size(small)) ///
	coeflabels(, labsize(small)) 
graph save "Figure3.gph", replace 
graph export "Figure3.eps", as(eps) replace 
graph export "Figure3.tif", as(tif) replace 
graph export "Figure3.wmf", as(wmf) replace 	
graph export "Figure3.png", as(png) height(1200) width(1600) replace 



****************************************************
*FIGURE 4 - Average Marginal Effects of Experimental Attributes on Perceptions of Police Misconduct
grstyle set graphsize 7.5 8.5 
reg E6_police_misconduct i.E6_vign2 i.E6_vign1
est store misconduct

coefplot (misconduct, level(95 90) ciopts(lcolor(black))  mlcolor(black) mfcolor(white)), ///
	xline(0, lcolor(black) lwidth(medium) lpat(shortdash)) baselevels  ///
	drop(_cons)  ylab(, labsize(small))  ///
	xtitle("Point estimates", size(small) margin(l+0 r+0 b+0 t+3)) ///
	xlab(-0.40(0.1).40, labsize(small)) /// 
	headings(0.E6_vign1 = "{bf: Gender}" ///
	0.E6_vign2 = "{bf:Occupation}") ///
	ciopts(recast(rspike)) ///
	mlabposition(center) ///
	title("") ///
	msize(small) msymbol(d) mlabposition(center) ///
	coeflabels(, labsize(small)) 	
	
graph save "Figure4.gph", replace 
graph export "Figure4.eps", as(eps) replace 
graph export "Figure4.tif", as(tif) replace 
graph export "Figure4.wmf", as(wmf) replace 	
graph export "Figure4.png", as(png) height(1200) width(1360) replace 


**************************************************************************
*FIGURE 5 - Marginal Effects of the Gender Treatment on Police Misconduct by Occupational Background Treatment
grstyle set graphsize 7.5 8.5 
anova E6_police_misconduct i.E6_vign2##i.E6_vign1
est store 	mod4

grstyle set legend 4, inside
grstyle numstyle legend_rows 2

est restore mod4
margins		E6_vign2, dydx(E6_vign1) level(90) post 

grstyle set graphsize 7.5 10
coefplot (, level(95 90) ciopts(lcolor(black))  mlcolor(black) mfcolor(white)), ///
	scale(0.95) ylab(-.8(.1).2, labsize(small)) vertical yline(0, lcolor(black) lpat(shortdash)) ///
	msize(small) msymbol(d) mlabposition(center) ///
	xlabel(1 "undefined" 2 "soldier" 3 "private security" 4 "self-defence" 5 "activist" 6 "US returnee", labsize(small))  ///	
	title("", margin(small) size(medium)) ///
	ytitle("ME(gender)", margin(l+0 r+2 b+0 t+0) size(small)) ///
	coeflabels(, labsize(small)) 

graph save "Figure5.gph", replace 
graph export "Figure5.eps", as(eps) replace 
graph export "Figure5.tif", as(tif) replace 
graph export "Figure5.wmf", as(wmf) replace 	
graph export "Figure5.png", as(png) height(1200) width(1600)  replace 

eststo clear 

**********************************************************************	

*Figure 6. Conditional Marginal Effects of the Gender Treatment on Police Effectiveness by Fear of and Exposure to Crime and Police Abuse

*Crime victimisation
reg E6_police_eff i.E6_vign1##i.E6_vign2##i.crime_victim
est store crime

est restore crime
margins 	r.E6_vign1, at(crime_victim=0) level(90) post
est store 	pr_7

est restore crime
margins 	r.E6_vign1, at(crime_victim=1) level(90) post
est store 	pr_8


*Fear of crime
reg E6_police_eff i.E6_vign1##i.E6_vign2##i.unsafe_neigh
est store fear

est restore fear
margins 	r.E6_vign1, at(unsafe_neigh=0) level(90) post
est store 	pr_9

est restore fear
margins 	r.E6_vign1, at(unsafe_neigh=1) level(90) post
est store 	pr_10

*Abuse 
reg E6_police_eff i.E6_vign1##i.E6_vign2##i.police_abuse
est store abuse 

est restore abuse
margins 	r.E6_vign1, at(police_abuse=0) level(90) post
est store 	pr_11

est restore abuse
margins 	r.E6_vign1, at(police_abuse=1) level(90) post
est store 	pr_12


*Bribe
reg E6_police_eff i.E6_vign1##i.E6_vign2##i.police_bribe
est store bribe

est restore bribe
margins 	r.E6_vign1, at(police_bribe=0) level(90) post
est store 	pr_13

est restore bribe
margins 	r.E6_vign1, at(police_bribe=1) level(90) post
est store 	pr_14


grstyle set graphsize 7.5 8.5
grstyle init 
grstyle set plain, nogrid
grstyle set color mono
grstyle set legend, nobox
grstyle set legend 6
grstyle numstyle legend_rows 1

*Figure 6a
coefplot (pr_7, level(95 90) label(Non-victim) msymbol(o)) ///
         (pr_8, level(95 90) label(Victim) msymbol(t)), ///
         yline(0, lcolor(black) lwidth(medium) lpattern(shortdash)) ///
         ytitle("", size(small) margin(l+0 r+0 b+0 t+2)) ///
         legend(title("") margin(tiny) size(small)) ///
         xlabel(none) ///
         xtitle("") ///
         title("{bf:Crime}", margin(l+0 r+0 b+2 t+0) size(medsmall)) /// 
         ylab(-0.2(0.2)0.6, labsize(small)) ///
         vertical ///
         graphregion(color(white) lcolor(black)) ///
         plotregion(margin(small) lcolor(black)) 
graph save "Figure6a.gph", replace 

	
*Figure 6b 
coefplot (pr_9, level(95 90) label(No fear) msymbol(o)) (pr_10, level(95 90) label(Fear of crime) msymbol(t)), ///
         yline(0, lcolor(black) lwidth(medium) lpattern(shortdash)) ///
         ytitle("", size(small) margin(l+0 r+0 b+0 t+2)) ///
         legend(title("") margin(tiny) size(small)) ///
         xlabel(none) ///
         xtitle("") ///
         title("{bf:Fear of crime}", margin(l+0 r+0 b+2 t+0) size(medsmall)) /// 
         ylab(-0.2(0.2)0.6, labsize(small)) ///
         vertical ///
         graphregion(color(white) lcolor(black)) ///
         plotregion(margin(small) lcolor(black)) 
graph save "Figure6b.gph", replace 



*Figure 6c
coefplot (pr_11, level(95 90) label(No abuse) msymbol(o)) (pr_12, level(95 90) label(Experienced abuse) msymbol(t)), ///
         yline(0, lcolor(black) lwidth(medium) lpattern(shortdash)) ///
         ytitle("", size(small) margin(l+0 r+0 b+0 t+2)) ///
         legend(title("") margin(tiny) size(small)) ///
         xlabel(none) ///
         xtitle("") ///
         title("{bf:Police abuse}", margin(l+0 r+0 b+2 t+0) size(medsmall)) /// 
         ylab(-0.2(0.2)0.6, labsize(small)) ///
         vertical ///
         graphregion(color(white) lcolor(black)) ///
         plotregion(margin(small) lcolor(black)) 
graph save "Figure6c.gph", replace 

*Figure 6d 
coefplot (pr_13, level(95 90) label(No bribery) msymbol(o)) (pr_14, level(95 90) label(Experienced bribery) msymbol(t)), ///
         yline(0, lcolor(black) lwidth(medium) lpattern(shortdash)) ///
         ytitle("", size(small) margin(l+0 r+0 b+0 t+2)) ///
         legend(title("") margin(tiny) size(small)) ///
         xlabel(none) ///
         xtitle("") ///
         title("{bf:Police bribery}", margin(l+0 r+0 b+2 t+0) size(medsmall)) /// 
         ylab(-0.2(0.2)0.6, labsize(small)) ///
         vertical ///
         graphregion(color(white) lcolor(black)) ///
         plotregion(margin(small) lcolor(black))  
graph save "Figure6d.gph", replace 


*Figure 6
grstyle set graphsize 7.5 7.5
graph combine "Figure6a" "Figure6b.gph"   "Figure6c.gph" "Figure6d.gph", cols(2) ///
		l1("	ME(gender)", size(vsmall) margin(l+0 r+2 b+0 t+0)) 
		
graph save "Figure6.gph", replace 
	graph export "Figure6.eps", as(eps) replace 
	graph export "Figure6.tif", as(tif) replace 
	graph export "Figure6.png", as(png) height(1200) width(1200) replace 
	graph export "Figure6.wmf", as(wmf) replace	
	

eststo clear 

**********************************************************************	

*Figure 7 Conditional Marginal Effects of the Gender Treatment on Police Misconduct by Fear of and Exposure to Crime and Police Abuse

*Crime victimisation
anova  E6_police_mis i.E6_vign1##i.E6_vign2##i.crime_victim
est store crime

est restore crime
margins 	r.E6_vign1, at(crime_victim=0) level(90) post
est store 	pr_7

est restore crime
margins 	r.E6_vign1, at(crime_victim=1) level(90) post
est store 	pr_8


*Fear of crime
anova E6_police_mis i.E6_vign1##i.E6_vign2##i.unsafe_neigh
est store fear

est restore fear
margins 	r.E6_vign1, at(unsafe_neigh=0) level(90) post
est store 	pr_9

est restore fear
margins 	r.E6_vign1, at(unsafe_neigh=1) level(90) post
est store 	pr_10

*Abuse 
anova E6_police_mis i.E6_vign1##i.E6_vign2##i.police_abuse
est store abuse 

est restore abuse
margins 	r.E6_vign1, at(police_abuse=0) level(90) post
est store 	pr_11

est restore abuse
margins 	r.E6_vign1, at(police_abuse=1) level(90) post
est store 	pr_12


*Bribe
anova E6_police_mis i.E6_vign1##i.E6_vign2##i.police_bribe
est store bribe

est restore bribe
margins 	r.E6_vign1, at(police_bribe=0) level(90) post
est store 	pr_13

est restore bribe
margins 	r.E6_vign1, at(police_bribe=1) level(90) post
est store 	pr_14


*Figure 7a
coefplot (pr_7, level(95 90) label(Non-victim) msymbol(d)) ///
         (pr_8, level(95 90) label(Victim) msymbol(s)), ///
         yline(0, lcolor(black) lwidth(medium) lpattern(shortdash)) ///
         ytitle("", size(small) margin(l+0 r+0 b+0 t+2)) ///
         legend(title("") margin(tiny) size(small)) ///
         xlabel(none) ///
         xtitle("") ///
         title("{bf:Crime}", margin(l+0 r+0 b+2 t+0) size(medsmall)) /// 
         ylab(-0.6(0.2)0.2, labsize(small)) ///
         vertical ///
         graphregion(color(white) lcolor(black)) ///
         plotregion(margin(small) lcolor(black)) 
graph save "Figure7a.gph", replace 

	
*Figure 7b 
coefplot (pr_9, level(95 90) label(No fear) msymbol(d)) (pr_10, level(95 90) label(Fear of crime) msymbol(s)), ///
         yline(0, lcolor(black) lwidth(medium) lpattern(shortdash)) ///
         ytitle("", size(small) margin(l+0 r+0 b+0 t+2)) ///
         legend(title("") margin(tiny) size(small)) ///
         xlabel(none) ///
         xtitle("") ///
         title("{bf:Fear of crime}", margin(l+0 r+0 b+2 t+0) size(medsmall)) /// 
         ylab(-0.6(0.2)0.2, labsize(small)) ///
         vertical ///
         graphregion(color(white) lcolor(black)) ///
         plotregion(margin(small) lcolor(black)) 
graph save "Figure7b.gph", replace 



*Figure 7c
coefplot (pr_11, level(95 90) label(No abuse) msymbol(d)) (pr_12, level(95 90) label(Experienced abuse) msymbol(s)), ///
         yline(0, lcolor(black) lwidth(medium) lpattern(shortdash)) ///
         ytitle("", size(small) margin(l+0 r+0 b+0 t+2)) ///
         legend(title("") margin(tiny) size(small)) ///
         xlabel(none) ///
         xtitle("") ///
         title("{bf:Police abuse}", margin(l+0 r+0 b+2 t+0) size(medsmall)) /// 
         ylab(-0.6(0.2)0.2, labsize(small)) ///
         vertical ///
         graphregion(color(white) lcolor(black)) ///
         plotregion(margin(small) lcolor(black)) 
graph save "Figure7c.gph", replace 

*Figure 7d 
coefplot (pr_13, level(95 90) label(No bribery) msymbol(d)) (pr_14, level(95 90) label(Experienced bribery) msymbol(s)), ///
         yline(0, lcolor(black) lwidth(medium) lpattern(shortdash)) ///
         ytitle("", size(small) margin(l+0 r+0 b+0 t+2)) ///
         legend(title("") margin(tiny) size(small)) ///
         xlabel(none) ///
         xtitle("") ///
         title("{bf:Police bribery}", margin(l+0 r+0 b+2 t+0) size(medsmall)) /// 
         ylab(-0.6(0.2)0.2, labsize(small)) ///
         vertical ///
         graphregion(color(white) lcolor(black)) ///
         plotregion(margin(small) lcolor(black))  
graph save "Figure7d.gph", replace 


*Figure 7

grstyle set graphsize 7.5 7.5
graph combine "Figure7a" "Figure7b.gph"   "Figure7c.gph" "Figure7d.gph", cols(2) ///
		l1("	ME(gender)", size(vsmall) margin(l+0 r+2 b+0 t+0)) 
graph save "Figure7.gph", replace 
	graph export "Figure7.eps", as(eps) replace 
	graph export "Figure7.tif", as(tif) replace 
	graph export "Figure7.png", as(png) height(1200) width(1200) replace 
	graph export "Figure7.wmf", as(wmf) replace 	




*****************************************************
*Figure A1. Conditional Marginal Effects of the Occupational Treatment on Police Effectiveness by Fear of and Exposure to Crime and Police Abuse
eststo clear

grstyle set graphsize 7.5 8.5 
grstyle init 
grstyle set plain, nogrid
grstyle set color mono
grstyle set legend, nobox
grstyle set legend 6
grstyle numstyle legend_rows 1


*Crime victimisation
reg E6_police_eff i.E6_vign1##i.E6_vign2##i.crime_victim
est store crime

est restore crime
margins 	r.E6_vign2, at(crime_victim=0) level(90) post
est store 	pr_7

est restore crime
margins 	r.E6_vign2, at(crime_victim=1) level(90) post
est store 	pr_8


*Fear of crime
reg E6_police_eff i.E6_vign1##i.E6_vign2##i.unsafe_neigh
est store fear

est restore fear
margins 	r.E6_vign2, at(unsafe_neigh=0) level(90) post
est store 	pr_9

est restore fear
margins 	r.E6_vign2, at(unsafe_neigh=1) level(90) post
est store 	pr_10

*Abuse 
reg E6_police_eff i.E6_vign1##i.E6_vign2##i.police_abuse
est store abuse 

est restore abuse
margins 	r.E6_vign2, at(police_abuse=0) level(90) post
est store 	pr_11

est restore abuse
margins 	r.E6_vign2, at(police_abuse=1) level(90) post
est store 	pr_12


*Bribery
reg E6_police_eff i.E6_vign1##i.E6_vign2##i.police_bribe
est store bribe

est restore bribe
margins 	r.E6_vign2, at(police_bribe=0) level(90) post
est store 	pr_13

est restore bribe
margins 	r.E6_vign2, at(police_bribe=1) level(90) post
est store 	pr_14


grstyle set graphsize 7.5 8.5 
grstyle init 
grstyle set plain, nogrid
grstyle set color mono
grstyle set legend, nobox
grstyle set legend 6
grstyle numstyle legend_rows 1

*Figure A1a
coefplot (pr_7, level(95 90) label(Non-victim) msymbol(o)) (pr_8, level(95 90) label(Victim) msymbol(t)), ///
	xline(0, lcolor(black) lwidth(medium) lpat(shortdash))  /// 
	xtitle("", size(small) margin(l+0 r+0 b+0 t+2)) ///
	legend(title("")  margin(tiny) size(small)) ///
	ylabel(1 "soldier" 2 "private security" 3 "self-defence" 4 "activist" 5 "US returnee", labsize(small)) ///
	title("{bf:Crime}",  margin(l+0 r+0 b+2 t+0) size(medsmall)) ///
	xlab(-0.6(0.3)0.6, labsize(small)) ///
	graphregion(color(white) lcolor(black)) ///
    plotregion(margin(small) lcolor(black))  
graph save "FigureA1a.gph", replace 


*Figure A1b 
coefplot (pr_9, level(95 90) label(No fear) msymbol(o)) (pr_10, level(95 90) label(Fear of crime) msymbol(t)), ///
	xline(0, lcolor(black) lwidth(medium) lpat(shortdash))  /// 
	xtitle("", size(small) margin(l+0 r+0 b+0 t+2)) ///
	legend(title("")  margin(tiny) size(small)) ///
	ylabel(1 "soldier" 2 "private security" 3 "self-defence" 4 "activist" 5 "US returnee", labsize(small)) ///
	title("{bf:Fear of crime}", margin(l+0 r+0 b+2 t+0) size(medsmall)) ///
	xlab(-0.6(0.3)0.6, labsize(small)) ///
	graphregion(color(white) lcolor(black)) ///
    plotregion(margin(small) lcolor(black))  
graph save "FigureA1b.gph", replace 


*Figure A1c 
coefplot (pr_11, level(95 90) label(No abuse) msymbol(o)) (pr_12, level(95 90) label(Experienced abuse) msymbol(t)), ///
	xline(0, lcolor(black) lwidth(medium) lpat(shortdash))  /// 
	xtitle("", size(small) margin(l+0 r+0 b+0 t+2)) ///
	legend(title("")  margin(tiny) size(small)) ///
	ylabel(1 "soldier" 2 "private security" 3 "self-defence" 4 "activist" 5 "US returnee", labsize(small)) ///
	title("{bf:Police abuse}", margin(l+0 r+0 b+2 t+0) size(medsmall)) ///
	xlab(-0.6(0.3)0.6, labsize(small)) ///
	graphregion(color(white) lcolor(black)) ///
    plotregion(margin(small) lcolor(black))  
graph save "FigureA1c.gph", replace 

*Figure A1d 
coefplot (pr_13, level(95 90) label(No bribery) msymbol(o)) (pr_14, level(95 90) label(Experienced bribery) msymbol(t)), ///
	xline(0, lcolor(black) lwidth(medium) lpat(shortdash))  /// 
	xtitle("", size(small) margin(l+0 r+0 b+0 t+2)) ///
	legend(title("")  margin(tiny) size(small)) ///
	ylabel(1 "soldier" 2 "private security" 3 "self-defence" 4 "activist" 5 "US returnee", labsize(small)) ///
	title("{bf:Police bribery}", margin(l+0 r+0 b+2 t+0) size(medsmall)) ///
	xlab(-0.6(0.3)0.6, labsize(small)) ///
	graphregion(color(white) lcolor(black)) ///
    plotregion(margin(small) lcolor(black))  
	
graph save "FigureA1d.gph", replace 


*Figure A1 Conditional Marginal Effects of the Occupational Treatment on Police Effectiveness by Fear of and Exposure to Crime and Police Abuse
grstyle set graphsize 7.5 9
graph combine "FigureA1a" "FigureA1b.gph"   "FigureA1c.gph" "FigureA1d.gph", cols(2) ///
		l1("	ME(Occupation)", size(vsmall) margin(l+0 r+2 b+0 t+0)) 
graph save "FigureA1.gph", replace 
	graph export "FigureA1.eps", as(eps) replace 
	graph export "FigureA1.tif", as(tif) replace 
	graph export "FigureA1.png", as(png) height (1200) width(1440) replace 
	graph export "FigureA1.wmf", as(png) replace


eststo clear 
*****************************************************
*Figure A2: Conditional marginal effects of experimental attributes by experiences with crime and violence

*Crime victimisation
reg E6_police_mis i.E6_vign1##i.E6_vign2##i.crime_victim
est store crime

est restore crime
margins 	r.E6_vign2, at(crime_victim=0) level(90) post
est store 	pr_7

est restore crime
margins 	r.E6_vign2, at(crime_victim=1) level(90) post
est store 	pr_8


*Fear of crime
reg E6_police_mis i.E6_vign1##i.E6_vign2##i.unsafe_neigh
est store fear

est restore fear
margins 	r.E6_vign2, at(unsafe_neigh=0) level(90) post
est store 	pr_9

est restore fear
margins 	r.E6_vign2, at(unsafe_neigh=1) level(90) post
est store 	pr_10

*Abuse 
reg E6_police_mis i.E6_vign1##i.E6_vign2##i.police_abuse
est store abuse 

est restore abuse
margins 	r.E6_vign2, at(police_abuse=0) level(90) post
est store 	pr_11

est restore abuse
margins 	r.E6_vign2, at(police_abuse=1) level(90) post
est store 	pr_12


*Bribe
reg E6_police_mis i.E6_vign1##i.E6_vign2##i.police_bribe
est store bribe

est restore bribe
margins 	r.E6_vign2, at(police_bribe=0) level(90) post
est store 	pr_13

est restore bribe
margins 	r.E6_vign2, at(police_bribe=1) level(90) post
est store 	pr_14


grstyle set graphsize 7.5 8.5 
grstyle init 
grstyle set plain, nogrid
grstyle set color mono
grstyle set legend, nobox
grstyle set legend 6
grstyle numstyle legend_rows 1

*Figure A2a
coefplot (pr_7, level(95 90) label(Non-victim) msymbol(d)) (pr_8, level(95 90) label(Victim) msymbol(s)), ///
	xline(0, lcolor(black) lwidth(medium) lpat(shortdash))  /// 
	xtitle("", size(small) margin(l+0 r+0 b+0 t+2)) ///
	legend(title("")  margin(tiny) size(small)) ///
	ylabel(1 "soldier" 2 "private security" 3 "self-defence" 4 "activist" 5 "US returnee", labsize(small)) ///
	title("{bf:Crime}",  margin(l+0 r+0 b+2 t+0) size(medsmall)) ///
	xlab(-0.6(0.3)0.6, labsize(small)) ///
	graphregion(color(white) lcolor(black)) ///
    plotregion(margin(small) lcolor(black)) 
graph save "FigureA2a.gph", replace 

	
*Figure A2b 
coefplot (pr_9, level(95 90) label(No fear) msymbol(d)) (pr_10, level(95 90) label(Fear of crime) msymbol(s)), ///
	xline(0, lcolor(black) lwidth(medium) lpat(shortdash))  /// 
	xtitle("", size(small) margin(l+0 r+0 b+0 t+2)) ///
	legend(title("")  margin(tiny) size(small)) ///
	ylabel(1 "soldier" 2 "private security" 3 "self-defence" 4 "activist" 5 "US returnee", labsize(small)) ///
	title("{bf:Fear of crime}", margin(l+0 r+0 b+2 t+0) size(medsmall)) ///
	xlab(-0.6(0.3)0.6, labsize(small)) ///
	graphregion(color(white) lcolor(black)) ///
    plotregion(margin(small) lcolor(black)) 
graph save "FigureA2b.gph", replace 


*Figure A2c 
coefplot (pr_11, level(95 90) label(No abuse) msymbol(d)) (pr_12, level(95 90) label(Experienced abuse) msymbol(s)), ///
	xline(0, lcolor(black) lwidth(medium) lpat(shortdash))  /// 
	xtitle("", size(small) margin(l+0 r+0 b+0 t+2)) ///
	legend(title("")  margin(tiny) size(small)) ///
	ylabel(1 "soldier" 2 "private security" 3 "self-defence" 4 "activist" 5 "US returnee", labsize(small)) ///
	title("{bf:Police abuse}", margin(l+0 r+0 b+2 t+0) size(medsmall)) ///
	xlab(-0.6(0.3)0.6, labsize(small)) ///
	graphregion(color(white) lcolor(black)) ///
    plotregion(margin(small) lcolor(black)) 
graph save "FigureA2c.gph", replace 

*Figure A2d 
coefplot (pr_13, level(95 90) label(No bribery) msymbol(d)) (pr_14, level(95 90) label(Experienced bribery) msymbol(s)), ///
	xline(0, lcolor(black) lwidth(medium) lpat(shortdash))  /// 
	xtitle("", size(small) margin(l+0 r+0 b+0 t+2)) ///
	legend(title("")  margin(tiny) size(small)) ///
	ylabel(1 "soldier" 2 "private security" 3 "self-defence" 4 "activist" 5 "US returnee", labsize(small)) ///
	title("{bf:Police bribery}", margin(l+0 r+0 b+2 t+0) size(medsmall)) ///
	xlab(-0.6(0.3)0.6, labsize(small)) ///
	graphregion(color(white) lcolor(black)) ///
    plotregion(margin(small) lcolor(black)) 
graph save "FigureA2d.gph", replace 



*Figure A2. Conditional Marginal Effects of the Occupational Treatment on Police Misconduct by Fear of and Exposure to Crime and Police Abuse
grstyle set graphsize 7.5 9 
graph combine "FigureA2a" "FigureA2b.gph"   "FigureA2c.gph" "FigureA2d.gph", cols(2) ///
		l1("	ME(Occupation)", size(vsmall) margin(l+0 r+2 b+0 t+0)) 
graph save "FigureA2.gph", replace 
	graph export "FigureA2.eps", as(eps) replace 
	graph export "FigureA2.tif", as(tif) replace 
	graph export "FigureA2.png", as(png) height (1200) width(1440) replace 
	graph export "FigureA2.wmf", as(wmf) replace 

